.class public Lcom/glympse/android/glympse/DlgPreferences;
.super Lcom/glympse/android/glympse/DlgShell;
.source "DlgPreferences.java"

# interfaces
.implements Lcom/glympse/android/glympse/DlgShell$DlgShellListener;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 13
    .parameter "oContext"

    .prologue
    const/16 v12, 0x8

    const/4 v11, 0x1

    .line 34
    const/4 v9, 0x0

    const v10, 0x7f030009

    invoke-direct {p0, p1, v9, v10}, Lcom/glympse/android/glympse/DlgShell;-><init>(Landroid/content/Context;Ljava/lang/String;I)V

    .line 35
    const v9, 0x7f02004a

    invoke-virtual {p0, v9}, Lcom/glympse/android/glympse/DlgPreferences;->SetTitleIcon(I)V

    .line 36
    const v9, 0x7f0a002c

    invoke-virtual {p0, v9}, Lcom/glympse/android/glympse/DlgPreferences;->SetTitleText(I)V

    .line 38
    const v9, 0x7f0a005b

    invoke-virtual {p0, v9}, Lcom/glympse/android/glympse/DlgPreferences;->SetOkText(I)V

    .line 39
    const v9, 0x7f0a0059

    invoke-virtual {p0, v9}, Lcom/glympse/android/glympse/DlgPreferences;->SetCancelText(I)V

    .line 40
    invoke-virtual {p0, p0}, Lcom/glympse/android/glympse/DlgPreferences;->SetDlgShellListener(Lcom/glympse/android/glympse/DlgShell$DlgShellListener;)V

    .line 43
    iget-object v9, p0, Lcom/glympse/android/glympse/DlgPreferences;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v10, 0x7f0c0027

    invoke-virtual {v9, v10}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v9

    check-cast v9, Landroid/widget/CheckBox;

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v10

    iget-object v10, v10, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-boolean v10, v10, Lcom/glympse/platform/Config;->m_fShareMyLocation:Z

    invoke-virtual {v9, v10}, Landroid/widget/CheckBox;->setChecked(Z)V

    .line 46
    iget-object v9, p0, Lcom/glympse/android/glympse/DlgPreferences;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v10, 0x7f0c0028

    invoke-virtual {v9, v10}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v9

    check-cast v9, Landroid/widget/CheckBox;

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v10

    iget-object v10, v10, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-boolean v10, v10, Lcom/glympse/platform/Config;->m_fShareSpeed:Z

    invoke-virtual {v9, v10}, Landroid/widget/CheckBox;->setChecked(Z)V

    .line 49
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v9

    iget-object v9, v9, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    iget v0, v9, Lcom/glympse/platform/LocManager;->m_eLocProvider:I

    .line 52
    .local v0, eLocProvider:I
    new-instance v7, Landroid/widget/ArrayAdapter;

    const v9, 0x1090008

    invoke-direct {v7, p1, v9}, Landroid/widget/ArrayAdapter;-><init>(Landroid/content/Context;I)V

    .line 53
    .local v7, oArrayAdapter:Landroid/widget/ArrayAdapter;,"Landroid/widget/ArrayAdapter<Ljava/lang/String;>;"
    const v9, 0x1090009

    invoke-virtual {v7, v9}, Landroid/widget/ArrayAdapter;->setDropDownViewResource(I)V

    .line 59
    const/4 v2, 0x0

    .line 62
    .local v2, nItems:I
    const-string v9, "Google"

    invoke-virtual {v7, v9}, Landroid/widget/ArrayAdapter;->add(Ljava/lang/Object;)V

    .line 63
    add-int/lit8 v3, v2, 0x1

    .end local v2           #nItems:I
    .local v3, nItems:I
    move v1, v2

    .line 66
    .local v1, nGoogle:I
    move v5, v1

    .line 67
    .local v5, nSkyhook:I
    sget-boolean v9, Lcom/glympse/platform/ProviderSkyhook;->SKYHOOK_SUPPORTED:Z

    if-nez v9, :cond_0

    if-ne v11, v0, :cond_6

    .line 69
    :cond_0
    const-string v9, "Skyhook"

    invoke-virtual {v7, v9}, Landroid/widget/ArrayAdapter;->add(Ljava/lang/Object;)V

    .line 70
    add-int/lit8 v2, v3, 0x1

    .end local v3           #nItems:I
    .restart local v2       #nItems:I
    move v5, v3

    .line 74
    :goto_0
    move v6, v1

    .line 75
    .local v6, nVerizon:I
    invoke-static {}, Lcom/glympse/platform/ProviderVerizon;->AllowVerizon()Z

    move-result v9

    if-nez v9, :cond_1

    const/4 v9, 0x2

    if-ne v9, v0, :cond_2

    .line 77
    :cond_1
    const-string v9, "Verizon"

    invoke-virtual {v7, v9}, Landroid/widget/ArrayAdapter;->add(Ljava/lang/Object;)V

    .line 78
    add-int/lit8 v3, v2, 0x1

    .end local v2           #nItems:I
    .restart local v3       #nItems:I
    move v6, v2

    move v2, v3

    .line 82
    .end local v3           #nItems:I
    .restart local v2       #nItems:I
    :cond_2
    move v4, v1

    .line 83
    .local v4, nSimulator:I
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v9

    iget-object v9, v9, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-boolean v9, v9, Lcom/glympse/platform/Config;->m_fDebug:Z

    if-nez v9, :cond_3

    sget-object v9, Lcom/glympse/android/glympseservice/GlympseService;->ms_oThis:Lcom/glympse/android/glympseservice/GlympseService;

    invoke-virtual {v9}, Lcom/glympse/android/glympseservice/GlympseService;->IsEmulator()Z

    move-result v9

    if-nez v9, :cond_3

    const/4 v9, -0x1

    if-ne v9, v0, :cond_4

    .line 85
    :cond_3
    const-string v9, "Simulator"

    invoke-virtual {v7, v9}, Landroid/widget/ArrayAdapter;->add(Ljava/lang/Object;)V

    .line 86
    add-int/lit8 v3, v2, 0x1

    .end local v2           #nItems:I
    .restart local v3       #nItems:I
    move v4, v2

    move v2, v3

    .line 90
    .end local v3           #nItems:I
    .restart local v2       #nItems:I
    :cond_4
    iget-object v9, p0, Lcom/glympse/android/glympse/DlgPreferences;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v10, 0x7f0c002c

    invoke-virtual {v9, v10}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v8

    check-cast v8, Landroid/widget/Spinner;

    .line 91
    .local v8, oSpinner:Landroid/widget/Spinner;
    invoke-virtual {v8, v7}, Landroid/widget/Spinner;->setAdapter(Landroid/widget/SpinnerAdapter;)V

    .line 94
    packed-switch v0, :pswitch_data_0

    .line 99
    :pswitch_0
    invoke-virtual {v8, v1}, Landroid/widget/Spinner;->setSelection(I)V

    .line 103
    :goto_1
    if-gt v2, v11, :cond_5

    .line 105
    iget-object v9, p0, Lcom/glympse/android/glympse/DlgPreferences;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v10, 0x7f0c002b

    invoke-virtual {v9, v10}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v9

    invoke-virtual {v9, v12}, Landroid/view/View;->setVisibility(I)V

    .line 106
    invoke-virtual {v8, v12}, Landroid/widget/Spinner;->setVisibility(I)V

    .line 110
    :cond_5
    iget-object v9, p0, Lcom/glympse/android/glympse/DlgPreferences;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v10, 0x7f0c002a

    invoke-virtual {v9, v10}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v9

    check-cast v9, Landroid/widget/Spinner;

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v10

    iget-object v10, v10, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget v10, v10, Lcom/glympse/platform/Config;->m_eExpireOnArrival:I

    invoke-virtual {v9, v10}, Landroid/widget/Spinner;->setSelection(I)V

    .line 113
    iget-object v9, p0, Lcom/glympse/android/glympse/DlgPreferences;->m_oViewGroupPanel:Landroid/view/ViewGroup;

    const v10, 0x7f0c002d

    invoke-virtual {v9, v10}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/widget/Spinner;

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v9

    iget-object v9, v9, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget v9, v9, Lcom/glympse/platform/Config;->m_eUnits:I

    invoke-virtual {p0, v9}, Landroid/widget/Spinner;->setSelection(I)V

    .line 114
    return-void

    .line 96
    .restart local p0
    :pswitch_1
    invoke-virtual {v8, v5}, Landroid/widget/Spinner;->setSelection(I)V

    goto :goto_1

    .line 97
    :pswitch_2
    invoke-virtual {v8, v6}, Landroid/widget/Spinner;->setSelection(I)V

    goto :goto_1

    .line 98
    :pswitch_3
    invoke-virtual {v8, v4}, Landroid/widget/Spinner;->setSelection(I)V

    goto :goto_1

    .end local v2           #nItems:I
    .end local v4           #nSimulator:I
    .end local v6           #nVerizon:I
    .end local v8           #oSpinner:Landroid/widget/Spinner;
    .restart local v3       #nItems:I
    :cond_6
    move v2, v3

    .end local v3           #nItems:I
    .restart local v2       #nItems:I
    goto/16 :goto_0

    .line 94
    :pswitch_data_0
    .packed-switch -0x1
        :pswitch_3
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method


# virtual methods
.method public OnCancel(Lcom/glympse/android/glympse/DlgShell;)V
    .locals 0
    .parameter "oDlgShell"

    .prologue
    .line 221
    return-void
.end method

.method public OnDismissed(Lcom/glympse/android/glympse/DlgShell;Z)V
    .locals 0
    .parameter "oDlgShell"
    .parameter "fOk"

    .prologue
    .line 226
    return-void
.end method

.method public OnOk(Lcom/glympse/android/glympse/DlgShell;)V
    .locals 9
    .parameter "oDlgShell"

    .prologue
    .line 126
    const v7, 0x7f0c0027

    invoke-virtual {p0, v7}, Lcom/glympse/android/glympse/DlgPreferences;->findViewById(I)Landroid/view/View;

    move-result-object v7

    check-cast v7, Landroid/widget/CheckBox;

    invoke-virtual {v7}, Landroid/widget/CheckBox;->isChecked()Z

    move-result v4

    .line 129
    .local v4, fShareMyLocation:Z
    const v7, 0x7f0c002c

    invoke-virtual {p0, v7}, Lcom/glympse/android/glympse/DlgPreferences;->findViewById(I)Landroid/view/View;

    move-result-object v7

    check-cast v7, Landroid/widget/Spinner;

    invoke-virtual {v7}, Landroid/widget/Spinner;->getSelectedItem()Ljava/lang/Object;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v6

    .line 132
    .local v6, strProvider:Ljava/lang/String;
    const/4 v1, 0x0

    .line 133
    .local v1, eLocProvider:I
    const-string v7, "Skyhook"

    invoke-virtual {v6, v7}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_7

    const/4 v1, 0x1

    .line 138
    :cond_0
    :goto_0
    const v7, 0x7f0c0028

    invoke-virtual {p0, v7}, Lcom/glympse/android/glympse/DlgPreferences;->findViewById(I)Landroid/view/View;

    move-result-object v7

    check-cast v7, Landroid/widget/CheckBox;

    invoke-virtual {v7}, Landroid/widget/CheckBox;->isChecked()Z

    move-result v5

    .line 141
    .local v5, fShareSpeed:Z
    const v7, 0x7f0c002a

    invoke-virtual {p0, v7}, Lcom/glympse/android/glympse/DlgPreferences;->findViewById(I)Landroid/view/View;

    move-result-object v7

    check-cast v7, Landroid/widget/Spinner;

    invoke-virtual {v7}, Landroid/widget/Spinner;->getSelectedItemPosition()I

    move-result v0

    .line 144
    .local v0, eExpireOnArrival:I
    const v7, 0x7f0c002d

    invoke-virtual {p0, v7}, Lcom/glympse/android/glympse/DlgPreferences;->findViewById(I)Landroid/view/View;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/widget/Spinner;

    invoke-virtual {p0}, Landroid/widget/Spinner;->getSelectedItemPosition()I

    move-result v2

    .line 146
    .local v2, eUnits:I
    const/4 v3, 0x0

    .line 149
    .local v3, fSave:Z
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-boolean v7, v7, Lcom/glympse/platform/Config;->m_fShareMyLocation:Z

    if-eq v7, v4, :cond_1

    .line 151
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iput-boolean v4, v7, Lcom/glympse/platform/Config;->m_fShareMyLocation:Z

    .line 152
    const/4 v3, 0x1

    .line 155
    sget-object v7, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v7, v7, Lcom/glympse/android/glympse/Glympse;->m_oViewTitleBar:Lcom/glympse/android/glympse/ViewTitleBar;

    invoke-virtual {v7}, Lcom/glympse/android/glympse/ViewTitleBar;->DoUpdate()V

    .line 167
    :cond_1
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget v7, v7, Lcom/glympse/platform/Config;->m_eLocProviderThisRun:I

    if-eq v7, v1, :cond_2

    .line 170
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iput v1, v7, Lcom/glympse/platform/Config;->m_eLocProviderThisRun:I

    .line 173
    if-nez v1, :cond_2

    .line 175
    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "DlgPreferences.Ok: Saving Location Provider setting of: "

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v7, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-static {v7}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 176
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iput v1, v7, Lcom/glympse/platform/Config;->m_eLocProviderPersist:I

    .line 177
    const/4 v3, 0x1

    .line 182
    :cond_2
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-boolean v7, v7, Lcom/glympse/platform/Config;->m_fShareSpeed:Z

    if-eq v7, v5, :cond_3

    .line 184
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iput-boolean v5, v7, Lcom/glympse/platform/Config;->m_fShareSpeed:Z

    .line 185
    const/4 v3, 0x1

    .line 189
    :cond_3
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget v7, v7, Lcom/glympse/platform/Config;->m_eExpireOnArrival:I

    if-eq v7, v0, :cond_4

    .line 191
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iput v0, v7, Lcom/glympse/platform/Config;->m_eExpireOnArrival:I

    .line 192
    const/4 v3, 0x1

    .line 196
    :cond_4
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget v7, v7, Lcom/glympse/platform/Config;->m_eUnits:I

    if-eq v7, v2, :cond_5

    .line 198
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iput v2, v7, Lcom/glympse/platform/Config;->m_eUnits:I

    .line 199
    const/4 v3, 0x1

    .line 202
    sget-object v7, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    const/high16 v8, 0x4000

    invoke-virtual {v7, v8}, Lcom/glympse/android/glympse/Glympse;->DoUpdate(I)V

    .line 206
    :cond_5
    if-eqz v3, :cond_6

    .line 208
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    invoke-virtual {v7}, Lcom/glympse/platform/Config;->Save()V

    .line 212
    :cond_6
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oLocManager:Lcom/glympse/platform/LocManager;

    const/4 v8, 0x0

    invoke-virtual {v7, v1, v8}, Lcom/glympse/platform/LocManager;->SetProvider(IZ)Z

    .line 215
    sget-object v7, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v7}, Lcom/glympse/android/glympse/Glympse;->PerformLocationCheck()V

    .line 216
    return-void

    .line 134
    .end local v0           #eExpireOnArrival:I
    .end local v2           #eUnits:I
    .end local v3           #fSave:Z
    .end local v5           #fShareSpeed:Z
    .restart local p0
    :cond_7
    const-string v7, "Verizon"

    invoke-virtual {v6, v7}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_8

    const/4 v1, 0x2

    goto/16 :goto_0

    .line 135
    :cond_8
    const-string v7, "Simulator"

    invoke-virtual {v6, v7}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_0

    const/4 v1, -0x1

    goto/16 :goto_0
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 0
    .parameter "savedInstanceState"

    .prologue
    .line 119
    invoke-super {p0, p1}, Lcom/glympse/android/glympse/DlgShell;->onCreate(Landroid/os/Bundle;)V

    .line 120
    return-void
.end method
